﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Qiang.Topology.Geometries
{
    public interface IGeometry : ICloneable, IComparable
    {
        
        #region 属性

        /// <summary>
        /// 图形类型
        /// </summary>
        string GeometryType { get; }

        /// <summary>
        /// 
        /// </summary>
        int SRID { get; }
        
        /// <summary>
        /// 维数。
        /// </summary>
        Dimensions Dimension { get; }

        /// <summary>
        /// 坐标集合
        /// </summary>
        Coordinate[] Coordinates { get;}

        /// <summary>
        /// 是否为空。
        /// </summary>
        bool IsEmpty { get; }

        /// <summary>
        /// 是否为简单几何图形。
        /// 简单几何图形：不存在自相切、自相交。
        /// </summary>
        bool IsSimple { get; }

        /// <summary>
        /// 图形范围
        /// </summary>
        IGeometry Envelope { get; }


        GeometryFactory Factory { get; }

        PrecisionModel PrecisionModel { get; }

        IEnvelope EnvelopeInternal { get; }

        IPoint Centroid { get; }

        Coordinate Coordinate { get; }

        double Area { get; }

        double Length { get; }



        bool IsValid { get; }

        int NumPoints { get; }

        #endregion


        #region 查询方法


        ///// <summary>
        ///// 在空间上，两个图形是否相等。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Equals(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，两个图形是否相离。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Disjoint(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，两个图形是否相交。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Intersects(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，两个图形是否相交。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Intersects(IEnvelope Envelope);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Touches(IGeometry Geometry);
        
        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Crosses(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，此图形是否在参数图形之内。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Within(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，此图形是否包含参数图形。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Contains(IGeometry Geometry);

        ///// <summary>
        ///// 在空间上，两个图形是否重叠。
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Overlaps(IGeometry Geometry);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="Geometry"></param>
        ///// <returns></returns>
        //bool Relate(IGeometry Geometry);

      


        #endregion

        
        #region 方法


        /// <summary>
        /// 
        /// </summary>
        /// <param name="Geometry"></param>
        /// <returns></returns>
        double Distance(IGeometry Geometry);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="distance"></param>
        /// <returns></returns>
        IGeometry Buffer(double distance);


        void Apply(ICoordinateFilter filter);

        void Apply(IGeometryFilter filter);

        void Apply(IGeometryComponentFilter filter);

        void GeometryChangedAction();

        bool EqualsExact(IGeometry other, double tolerance);

        bool EqualsExact(IGeometry other);

        void Normalize();

        void GeometryChanged();

        object Clone();

        #endregion


     
       

     



    }
}
